const bamboos = document.querySelector(".bamboo-wrapper");
const frag = document.createDocumentFragment();
let quantity = 150;
(() => {
  if (window.innerWidth < 768) {
    quantity = 50;
  } else if (window.innerWidth < 1024) {
    quantity = 100;
  }
})();

for (let i = 0; i < quantity; i++) {
  const tree = document.createElement("div");
  tree.classList.add("bamboo-tree");
  tree.classList.add(`tree-${i + 1}`);
  ["one", "two", "three"].forEach((item) => {
    const detail = document.createElement("div");
    detail.classList.add("tree-detail");
    detail.classList.add(item);
    tree.appendChild(detail);
  });
  frag.appendChild(tree);
}

bamboos.appendChild(frag);
